import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import eslintPlugin from 'vite-plugin-eslint'

// https://vitejs.dev/config/
export default defineConfig(mode => {
  return {
    plugins: [vue(), eslintPlugin({ cache: false })],
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './src')
      },
      // https://cn.vitejs.dev/config/#resolve-extensions
      extensions: ['.js']
    },
    server: {
      port: 8080,
      host: true
    }
  }
})
